            <?php
                $sql = "SELECT b_img , b_url FROM hs_banner WHERE b_id=1";
                $banner_info = $db->queryUniqueObject($sql);
                
                if($banner_info->b_img!='' && file_exists(APPPATH.'/images/banner/'.$banner_info->b_img)){
                    
                    if($banner_info->b_url!=''){
                        $center_banner = '<div id="center_banner"><a href="'.$banner_info->b_url.'" title="Hongchiao"><img src="images/banner/'.$banner_info->b_img.'" alt="Hongchiao" class="img_link" /></a></div>';
                    }else{
                        $center_banner = '<div id="center_banner"><img src="images/banner/'.$banner_info->b_img.'" alt="Hongchiao" class="img_link" /></div>';
                    }
                    
                }else{
                    $center_banner = '<div id="center_banner">&nbsp;</div>';
                }
                
                echo $center_banner;
                
                $rss = $db->query('SELECT * FROM hs_category ORDER BY c_id');
                $catList = '';
                $x = 0;
                while ($line = $db->fetchNextObject($rss)){
                    
                    $class = '';
                    if(($x++)==0){
                        $class = 'left_product_cat_list_first';
                    }
                    
                    $catList .=<<<catList
                        <div class="left_product_cat_list {$class}">
                            <div class="left_product_cat_img">
                                <a href="product.php?id={$line->c_id}" title="{$line->c_name}"><img src="images/products/category/{$line->c_id}/{$line->c_img2}" alt="{$line->c_name}" class="img_link" /></a>
                            </div>
                            <div class="left_product_cat_name">
                                <a href="product.php?id={$line->c_id}" title="{$line->c_name}">{$line->c_name}</a>
                            </div>
                        </div>
catList;
                }
            ?>
            
            <div id="left_sidebar">
                <div id="left_product_cat_list">
                    <div class="left_block_head">&nbsp;</div>
                    
                    <?php echo $catList; ?>
                    
                    <div class="left_block_foot">&nbsp;</div>
                </div>
                
                <div id="left_sidebar_search" class="left_block">
                    <img src="images/search_block_title.jpg" alt="Search" class="img_link block_title" />
                    
                    <div class="left_block_content">
                        <select name="" id="left_sidebar_search_select">
                            <?php echo $cat_search_list; ?>
                        </select>
                    </div>
                    
                    <div class="left_block_foot">&nbsp;</div>
                </div>
                
                <?php
                    $sql = "SELECT p_img , p_banner , p_active FROM hs_promotion WHERE p_id=1";
                    $promo_info = $db->queryUniqueObject($sql);
                    if($promo_info->p_img!='' && file_exists(APPPATH.'/images/promotions/'.$promo_info->p_img) && $promo_info->p_active==1 && $promo_info->p_banner!='' && file_exists(APPPATH.'/images/promotions/'.$promo_info->p_banner)){
                ?>
                <div id="left_sidebar_promotion" class="left_block">
                    <img src="images/promotion_block_title.jpg" alt="Promotion" class="block_title" />
                    
                    <div class="left_block_content">
                        <a href="images/promotions/<?php echo $promo_info->p_img; ?>" class="apromobox" title="Promotion"><img src="images/promotions/<?php echo $promo_info->p_banner; ?>" alt="Promotion" class="img_link" /></a>
                    </div>
                    
                    <div class="left_block_foot">&nbsp;</div>
                    <script>
                        $(document).ready(function() {
                            $("a.apromobox").fancybox({
                                    'speedIn'		:	600, 
                                    'speedOut'		:	200, 
                                    'titleShow'	:	false,
                                    'opacity' : true,
                                    'padding' : 10,
                                    'margin' : 0
                            });
                                
                        });
                    </script>
                </div>
                <?php
                    }
                ?>
                
            </div>